// components/good/good.js
import util from "../../../utils/utils";
let systemInfo = wx.getSystemInfoSync();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    static_host:{
      type:String,
      value:''
    },
    detail: Object, // 商品信息
  },
  /**
   * 组件的初始数据
   */
  data: {
    windowWidth:systemInfo.windowWidth,
    showServiceText:false,
    showTipText:false,
    swiperCurrent: 1,
    tipData:{
      title:'这些人正在参与免单',
      btn:'查看如何免单',
      url:'',
      data:[]
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChangeSwiper: function (e) {
      this.setData({swiperCurrent: e.detail.current + 1})
    },
    openServiceDialog:function(){
      this.setData({
        showServiceText:true,
      })
    },
    closeServiceDialog:function(){
      this.setData({
        showServiceText:false,
      })
    },
    showTipBox:function (e) {
      let type = parseInt(e.currentTarget.dataset.type);
      this.triggerEvent('showTipBox',{type:type});
    },

    receiveCard:function () {
      this.triggerEvent('receive');
    },
    toPage:function (e) {
      console.log(e);
      this.triggerEvent('toPage',e);
    },
  }
});
